﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Wall : MonoBehaviour {

    private Rigidbody2D rb2d;

    private float scrollSpeed = -5.0f;

    // Use this for initialization
    void Start () {
        //Get and store a reference to the Rigidbody2D attached to this GameObject.
        rb2d = GetComponent<Rigidbody2D> ();

        //Start the object moving.
        rb2d.velocity = new Vector2 (scrollSpeed, 0);
    }

    void Update () {
        // If the game is over, stop scrolling.
        if (GameManaer.instance.isGameOver) {
            rb2d.velocity = Vector2.zero;
        }
    }
}